﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ExaminationTT.View
{
    //IEnumerable<IExam> Exams { get; }
    //    string ConflitType { get; }
    //    string ConflitInfo { get; }
    //    string RuleName { get; }
    //    ConflitWeight Weight { get; }
    //    IEnumerable<IStudent> AffectedStudents { get; }
    public class ConflitGridView : System.Windows.Forms.DataGridView
    {
        private DataGridViewTextBoxColumn _conflitType;
        private DataGridViewTextBoxColumn _conflitInfo;
        private DataGridViewTextBoxColumn _ruleName;
        private DataGridViewTextBoxColumn _weight;
        private DataGridViewTextBoxColumn _affectedStudentsCount;

        public ConflitGridView()
        {
            _conflitType = new DataGridViewTextBoxColumn();
            _conflitInfo = new DataGridViewTextBoxColumn();
            _ruleName = new DataGridViewTextBoxColumn();
            _weight = new DataGridViewTextBoxColumn();
            _affectedStudentsCount = new DataGridViewTextBoxColumn();
            this.AutoGenerateColumns = false;
            _conflitType.Name = "_conflitType";
            _conflitType.HeaderText = "Tipo de conflito";
            _conflitType.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
            _conflitType.DataPropertyName = "ConflictType";
            _conflitType.Width = 120;
            _ruleName.Name = "_ruleName";
            _ruleName.HeaderText = "Regra violada";
            _ruleName.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
            _ruleName.DataPropertyName = "RuleName";
            _ruleName.Width = 100;
            _weight.Name = "_weight";
            _weight.HeaderText = "Severidade";
            _weight.DataPropertyName = "Weight";
            _weight.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
            _conflitInfo.Name = "_conflitInfo";
            _conflitInfo.HeaderText = "Descrição do conflito";
            _conflitInfo.DataPropertyName = "ConflitcInfo";
            _conflitInfo.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            _affectedStudentsCount.Name = "_affectedStudentsCount";
            _affectedStudentsCount.HeaderText = "Nº Estudantes Affectados";
            _affectedStudentsCount.DataPropertyName = "AffectedStudentsCount";
            _affectedStudentsCount.Width = 100;

            

        }

        public void SetColumns()
        {
            this.Columns.Add(_conflitType);
            this.Columns.Add(_ruleName);
            this.Columns.Add(_weight);
            this.Columns.Add(_affectedStudentsCount);
            this.Columns.Add(_conflitInfo);

        }
    }
}
